#ifndef GROUP_H
#define GROUP_H

#include <string>
#include <vector>
#include "groupuser.hpp"

using namespace std;

// Group表的ORM表
class Group
{
public:
    Group(int id = -1, const std::string name = "", std::string desc = "")
        : _gid(id), _name(name), _desc(desc)
    {
    }
    ~Group() = default;

    void setId(int gid) { _gid = gid; }
    void setName(const std::string name) { _name = name; }
    void setDesc(const std::string desc) { _desc = desc; }

    int getGId() { return _gid; }
    std::string getName() { return _name; }
    std::string getDesc() { return _desc; }
    int getGId() const { return _gid; }
    std::string getName() const { return _name; }
    std::string getDesc() const { return _desc; }
    // 获取群员
    std::vector<GroupUser>& getUser() { return _users; }
    

protected:
    int _gid;
    std::string _name;
    std::string _desc;             // 群描述
    std::vector<GroupUser> _users; // 存储一个群里的所有群员
};

#endif